#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include "array_aux.h"
void insertion_sort(vector<int>& array)
{
     for (int j = 2; j <=array.size()-1; j++ )
     {
         int key = array[j];
         int i = j -1;
         while ( i > 0 &&  array[i] < key)
         {
               array[i+1] = array[i];
               i --;
         }
         array[i + 1] = key;
     }
}

int main(int argc, char *argv[])
{

  vector<int>array = get_array(10);

  display_array(array);
  insertion_sort(array);
  display_array(array);
  system("PAUSE");
  return 0;
}
